<script setup>
  import { uniFetch } from '@/apis/uni-fetch.js'

  import { onMounted,ref } from 'vue'

  const truchInfo = ref({})

  onMounted(async () => {
    let res = await uniFetch.get('/driver/users/truck')
    truchInfo.value = res.data.data
    console.log(res.data.data);
  })
</script>

<template>
  <view class="page-container">
    <swiper
     class="truck-pictures"
     indicator-active-color="#fff"
     circular
     indicator-dots
     >
      <swiper-item v-for="img in truchInfo.pictureList" :key="img.url">
        <image class="picture"
        mode="aspectFill"
        :src="img.url"
        ></image>
      </swiper-item>

    </swiper>
    <view class="truck-meta">
      <uni-list :border="false">
        <uni-list-item :border="false" title="车辆编号" :rightText="truchInfo.id" />
        <uni-list-item :border="false" title="车辆号牌" :rightText="truchInfo.licensePlate" />
        <uni-list-item :border="false" title="车型" :rightText="truchInfo.truckType" />
        <uni-list-item :border="false" title="所属机构" :rightText="truchInfo.currentOrganName" />
        <uni-list-item :border="false" title="载重" :rightText="truchInfo.allowableLoad" />
      </uni-list>
    </view>
  </view>
</template>

<style lang="scss" scoped>
  @import './index.scss';
</style>
